using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum e_Enemystate
{
    NullTransition,
    SeeEnemy,
    NoEnemy,
    CanAttack
}
public enum e_EnemystateId
{
    NullStat,
    Idle,
    Chase,
    Attack
}
public abstract class IEnemyFSM
{
    protected Dictionary<e_Enemystate, e_EnemystateId> map = new Dictionary<e_Enemystate, e_EnemystateId>();
    protected e_EnemystateId mEnemystateId;
    public e_EnemystateId StateId { get => mEnemystateId; set => mEnemystateId = value; }
    protected EnemyFSMSystem mFSMSystem;
    protected IEnemy mCharacter;
    public IEnemyFSM(EnemyFSMSystem fSMSystem)
    {
        mFSMSystem = fSMSystem;
    }
    public void AddTransition(e_Enemystate state, e_EnemystateId id)
    {
        if (state == e_Enemystate.NullTransition)
        {
            Debug.LogWarning("1111");
            return;
        }
        if (id == e_EnemystateId.NullStat)
        {
            Debug.LogWarning("11111");
            return;
        }
        if (map.ContainsKey(state))
        {
            Debug.LogWarning("11111");
            return;
        }
        map.Add(state, id);
    }
    public void DeletTransition(e_Enemystate state)
    {
        if (!map.ContainsKey(state))
        {
            Debug.LogWarning("11111");
            return;
        }
        map.Remove(state);
    }
    public e_EnemystateId GetStateId(e_Enemystate state)
    {
        if (!map.ContainsKey(state))
        {
            return e_EnemystateId.NullStat;
        }
        else
        {
            return map[state];
        }
    }
    public abstract void DoBeforeEnter();
    public abstract void DoBeforeLave();
    public abstract void Update();

}
